/*
 * jxUtils Project (2013, 2014)
 * 
 * by Denilson Edinaldo Pinto
 * 
 * LGPL
 * Copyright (C) 2014
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
package org.jxUtils.date;

import org.jxUtils.i18n.I18N;

/**
 * @author Denilson Edinaldo Pinto
 * @project jxUtils
 * @package org.jxUtils.date
 * @date 06/02/2013 - 22:04:17
 */
public enum PhaseMoon {
	
	CRESCENT_CONCAVE(1, I18N.moon().crescentMoonConcave()),
	CRESCENT_CONVEX(3, I18N.moon().crescentMoonConvex()),
	FULL_MOON(4, I18N.moon().fullMoon()),
	NEW_MOON(0, I18N.moon().newMoon()),
	QUARTER_CRESCENT(2, I18N.moon().quarterCrescent()),
	QUARTER_WANING(6, I18N.moon().quarterWaning()),
	WANING_CONCAVE(7, I18N.moon().waningMoonConcave()),
	WANING_CONVEX(5, I18N.moon().waningMoonConvex());
	
	private String name;
	
	private int phase;
	
	/**
	 * @param phase
	 * @param name
	 */
	PhaseMoon(final int phase, final String name) {
	
		this.phase = phase;
		this.name = name;
	}
	
	/**
	 * @return the name
	 */
	public String getName() {
	
		return name;
	}
	
	/**
	 * @return the phase
	 */
	public int getPhase() {
	
		return phase;
	}
	
	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
	
		return name;
	}
	
	/**
	 * @param phase
	 * @return {@link PhaseMoon}
	 */
	public static String get(final int phase) {
	
		switch(phase) {
		
			case 0:
				
				return NEW_MOON.getName();
				
			case 1:
				
				return CRESCENT_CONCAVE.getName();
				
			case 2:
				
				return QUARTER_CRESCENT.getName();
				
			case 3:
				
				return CRESCENT_CONVEX.getName();
				
			case 4:
				
				return FULL_MOON.getName();
				
			case 5:
				
				return WANING_CONVEX.getName();
				
			case 6:
				
				return QUARTER_WANING.getName();
				
			case 7:
				
				return WANING_CONCAVE.getName();
				
			default:
				
				return "";
		}
	}
}
